import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/sysuser/login',
    method: 'post',
    data
  })
}
//用户列表
export function userList(params) {
  return request({
    url: '/sysuser/page',
    method: 'get',
    params
  })
}
//门店列表
export function storeList(params) {
  return request({
    url: '/store/page',
    method: 'get',
    params
  })
}
//门店删除
export function storeDel(params) {
  return request({
    url: '/store/delete',
    method: 'delete',
    params
  })
}
//门店修改
export function storeUpdate(data) {
  return request({
    url: '/store/update',
    method: 'put',
    data
  })
}
//门店增加
export function storeAdd(data) {
  return request({
    url: '/store/save',
    method: 'post',
    data
  })
}
//角色列表
export function roleList(params) {
  return request({
    url: '/sysrole/page',
    method: 'get',
    params
  })
}
//新增员工
export function userAdd(data) {
  return request({
    url: '/sysuser/save',
    method: 'post',
    data
  })
}
//修改员工
export function userUpdate(data) {
  return request({
    url: '/sysuser/update',
    method: 'put',
    data
  })
}
//删除员工
export function userDelete(params) {
  return request({
    url: '/sysuser/delete',
    method: 'delete',
    params
  })
}

// 图片上传
export function img(data) {
  return request({
    url: 'upload/fileUpload/upload',
    method: 'post',
    data
  })
}
//会员查询
export function memberList(params) {
  return request({
    url: '/member/page',
    method: 'get',
    params
  })
}
//会员增加
export function memberAdd(data) {
  return request({
    url: '/member/save',
    method: 'post',
    data
  })
}
//会员删除
export function memberDel(params) {
  return request({
    url: '/member/delete',
    method: 'delete',
    params
  })
}
//会员修改
export function memberUpdate(data) {
  return request({
    url: '/member/update',
    method: 'put',
    data
  })
}
//积分入账
export function integralEnterLogIn(data){
  return request({
    url: '/integralEnterLog/save',
    method: 'post',
    data
  })
}
//积分入账记录
export function integralEnterLogInList(params){
  return request({
    url: '/integralEnterLog/page',
    method: 'get',
    params
  })
}
//积分抵扣
export function integralEnterLogOut(params){
  return request({
    url: '/integralDeductionLog/page',
    method: 'get',
    params
  })
}
//积分抵扣新增
export function integralEnterLogOutAdd(data){
  return request({
    url: '/integralDeductionLog/save',
    method: 'post',
    data
  })
}
//积分明细
export function integralEnterLogDetails(params){
  return request({
    url: '/consumption/integral',
    method: 'get',
    params
  })
}
//积分明细汇总

export function integralEnterLogAll(params){
  return request({
    url: '/integralAllLogView/page',
    method: 'get',
    params
  })
}
export function getEnterStatistics(params){
  return request({
    url: '/integralEnterLog/getEnterStatistics',
    method: 'get',
    params
  })
}
//会员消费走势
export function getDateEnterStatistics(params){
  return request({
    url: '/integralEnterLog/getDateEnterStatistics',
    method: 'get',
    params
  })
}
//查询文化墙
export function culturalWall(params){
  return request({
    url: '/culturalWall/page',
    method: 'get',
    params
  })
}
//新增文化墙

export function culturalWallAdd(data){
  return request({
    url: '/culturalWall/save',
    method: 'post',
    data
  })
}

// 会员占比
export function vip(params){
  return request({
    url: '/integralEnterLog/getMemberEnterStatistics',
    method: 'get',
    params
  })
}
//单量
export function order(params){
  return request({
    url: '/integralEnterLog/getAllStoreEnterLog',
    method: 'get',
    params
  })
}


export function logout() {
  return request({
    url: '/user/logout',
    method: 'post'
  })
}
